package in.co.codedoc.event;

import java.lang.reflect.Method;

import in.co.codedoc.cg.annotations.IsAnIOCComponent;

@IsAnIOCComponent
@SuppressWarnings("unchecked")
public class AsynchronousEventRegistry
	extends EventRegistryBase
{
	public AsynchronousEventRegistry(SynchronousEventRegistry synchEventRegistry,EventAsynchronizer asynchronizer)
	{
		this.synchEventRegistry = synchEventRegistry;
		this.asynchronizer = asynchronizer;
	}
	
	@Override
	public synchronized void Register(Class eventType, Object handler,Method method,boolean matchEventTypeExactly)
	{
		super.Register(eventType, handler, method,matchEventTypeExactly);
		
		synchEventRegistry.Register(eventType, asynchronizer);
	}

	private SynchronousEventRegistry synchEventRegistry;
	private EventAsynchronizer asynchronizer;

}
